/*
 * Copyright (C) 2009 M. Hautle.
 * 
 * This file is part of TrackedBean.
 * 
 * TrackedBean is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option) any later version.
 * 
 * TrackedBean is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License along with TrackedBean. If not, see <http://www.gnu.org/licenses/>.
 */
package ch.trackedbean.binding.beanSpec;

/**
 * The status flags of a property/bean
 * 
 * @author M. Hautle
 */
public enum BeanStatusFlag {
	/**
	 * The property/bean is undefined (lazy property was not yet loaded)
	 */
	UNDEFINED(0, 0),
	/**
	 * The property/bean is unchanged
	 */
	UNCHANGED(0, 0),
	/**
	 * The property/bean is changed
	 */
	CHANGED(0, 1),
	/**
	 * The property/bean was deleted
	 */
	DELETED(0, 0),
	/**
	 * The property/bean contains an error
	 */
	ERROR(1, 0),
	/**
	 * A technical error occoured while setting a new value
	 */
	TECHNICAL_ERROR(1, 0);

	/** Internal value for error count computation */
	int errorValue;

	/** Internal value for changed count computation */
	int changedValue;

	/**
	 * @param errorValue Internal value for the error count computation
	 * @param changedValue Internal value for the changed count computation
	 */
	BeanStatusFlag(final int errorValue, final int changedValue) {
		this.errorValue = errorValue;
		this.changedValue = changedValue;
	}
}
